package com.vf.admin.client.dao;

import com.vf.admin.common.db.BaseDao;
import com.vf.admin.miaodong.entity.AppRoomType;
import com.vf.admin.utils.StringEx;
import org.springframework.stereotype.Repository;

import java.util.ArrayList;
import java.util.List;

/**
 * 房间类型
 */
@Repository
public class AppRoomTypeDao extends BaseDao<AppRoomType> {
    /**
     * 查询列表
     */
    public List<AppRoomType> list(Integer xingzhi) {
        ArrayList<Object> paramList = new ArrayList<Object>();
        StringBuilder sbStr = new StringBuilder("select * from app_roomtype where 1=1  ");
        sbStr.append(" and xingzhi=? ");
        paramList.add(xingzhi);
        sbStr.append(" and state=1 ");
        sbStr.append(" order by paixu asc");
        String sql = sbStr.toString();
        return this.queryList(sql,paramList, AppRoomType.class,null);
    }

    /**
     * 详情
     */
    public AppRoomType get(Integer id) {
        if (StringEx.isNullOrLing(id)) {
            return null;
        }
        List<Object> paramList = new ArrayList<Object>();
        StringBuilder sbStr = new StringBuilder("select * from app_roomtype where 1=1");
        sbStr.append(" and id = ? ");
        paramList.add(id);
        String sql = sbStr.toString();
        return this.queryObj(sql, paramList, AppRoomType.class);
    }



}
